package cn.springcloud.fix.demo.design.delegate;

/**
 * 委托
 */
public class TeamLeader implements Programmer {

    private JavaCoder javaCoder;

    public TeamLeader() {
        this.javaCoder = new JavaCoder();
    }

    @Override
    public void coding() {
        System.out.println("需要coding");
        javaCoder.coding();//项目leader让程序员去写代码
        drink();//自己却在喝茶
    }

    private void drink() {
        System.out.println("让程序员去写代码，我就安心喝茶吧！");
    }

    public static void main(String[] args) {
        TeamLeader teamLeader = new TeamLeader();
        teamLeader.coding();
    }
}
